/*左右两边圆弧的按钮-只有边框*/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:frametrim/utility/screen.dart';
import 'package:frametrim/utility/sq_color.dart';
import 'package:frametrim/views/button_circle.dart';

//点击事件回调
// typedef void onPressCallback(arg);
class ButtonRoundSingleView extends StatelessWidget {
  late final String textStr;
  late final Color textColor;
  late final double textSize;
  late final double mHorizontalPadding;
  late final double mVerticalPadding;
  late final Color buttonColor;
  late final VoidCallback onPress;

  ButtonRoundSingleView(
      {Key? key,
      required this.textStr,
      required this.textColor,
      this.textSize = 18,
      this.mHorizontalPadding = 10,
      this.mVerticalPadding = 5,
      required this.buttonColor,
      required this.onPress});

  @override
  Widget build(BuildContext context) {
    return Container(
      /*  height: 45,
      width: Screen.width,
      margin: EdgeInsets.fromLTRB(28, 10, 28, 10),*/
      child: RaisedButton(
        padding: EdgeInsets.symmetric(
            horizontal: mHorizontalPadding, vertical: mVerticalPadding),
        /*按钮颜色*/
        color: SQColor.white,
        textColor: textColor,
        child: Text(
          textStr,
          style: TextStyle(fontSize: textSize),
        ),
        /*圆角样式*/
        shape: RoundedRectangleBorder(
            side: BorderSide(
                width: 1, color: buttonColor, style: BorderStyle.solid),
            borderRadius: BorderRadius.all(Radius.circular(5))),
        // 水波动画中水波的颜色
        splashColor: SQColor.white,
        // 按钮按下时的背景颜色
        highlightColor: SQColor.white,
        elevation: 0,
        onPressed: onPress,
      ),
    );
  }
}
